package com.example.leetcode.leetcode.list;



public class ListNode {
    public int val;
    public ListNode next;
    public ListNode() {}
    public ListNode(int val) { this.val = val; }
    ListNode(int val, ListNode next) { this.val = val; this.next = next; }
    public void ListNodesBuild(ListNode ... listNodes){
        ListNode head = listNodes[0];
        for (int i = 1; i < listNodes.length; i++) {
            head.next = listNodes[i];
            head = head.next;
        }
    }
}